#include <stdio.h>
#include <math.h>

void timebtoa(short int a[1010], short int b[1010])
{
    short int c[1010] = {0};
    for (int i = 499; i >= 0; i--)
    {
        for (int j = 499; j >= 0; j--)
        {
            if (i + j < 500)
                c[i + j] += a[i] * b[j];
        }
    }
    for (int i = 0; i < 500; i++)
    {
        if (c[i] >= 10)
        {
            c[i + 1] += c[i] / 10;
            c[i] %= 10;
        }
        a[i] = c[i];
    }
}

int main()
{
    int n;
    short int ans[1010] = {0}, tmp[1010] = {0};
    scanf("%d", &n);
    printf("%d\n", (int)(n * log10(2) + 1));
    ans[0] = 1;
    tmp[0] = 2;
    while (n > 0)
    {
        if (n % 2 == 1)
        {
            timebtoa(ans, tmp);
        }





        
        timebtoa(tmp, tmp);
        n /= 2;
    }
    ans[0] -= 1;
    for (int i = 499; i >= 0; i--)
    {
        if ((i + 1) % 50 == 0 && (i) != 499)
        {
            printf("\n%hd", ans[i]);
        }
        else
            printf("%hd", ans[i]);
    }
    return 0;
}